package gonnectd

import (
	"github.com/cz-it/gonnectd/utils/log"
	"github.com/cz-it/gonnectd/utils/config"
	"github.com/cz-it/gonnectd/server"

	"unsafe"
)

func OpenLogcat() {
	log.Info("open logcat")
}

func CloseLogcat() {
	log.Info("close logcat");
}

func Run() {
	log.Info("Start run gonnectd")
	svrctx := server.New()
//	svrctx.SetXxx()
	svrctx.Run()
}

func Init(cfg ConfigInfo) error {
	var err error
	err = config.Init((*config.ConfigInfo) (unsafe.Pointer(&cfg)) )
	if err != nil {
		return err
	}
	
	logPath := config.LogPath
	err = log.Init(logPath)
	log.Debug("logpath:",logPath)
	if err != nil {
		return err
	}
	return nil
}














